from python_homework.hero import timo, police


class HeroFactory:
    def create_hero(self, name):
        if name == "timo":
            return timo()
        elif name == "police":
            return police()
        else:
            print("输入的英雄不在英雄工厂的列表中")


if __name__ == '__main__':
    hero_factory = HeroFactory()
    timo = hero_factory.create_hero('timo')
    police = hero_factory.create_hero('police')
    timo.fight(police.hero_hp, police.hero_power, police.hero_name)
